package com.ck.daoImpl;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.ck.dao.TeacherDAO;
import com.ck.domain.Teacher;

public class TeacherDAOImpl extends SqlMapClientDaoSupport implements
		TeacherDAO {

	public Teacher getTeacherById(Integer id){
		return (Teacher) getSqlMapClientTemplate().queryForObject("getTeacherById",id);
	}
	
	public Teacher getTeacherByUsername(String username) {
		return (Teacher) getSqlMapClientTemplate().queryForObject("getTeacherByUsername",username);
	}

	public void updateTeacherLastLoginTime(Teacher teacher) {
		getSqlMapClientTemplate().update("updateTeacherLastLoginTime", teacher);
	}

	public void updateTeacherOwnInfo(Teacher teacher) {
		getSqlMapClientTemplate().update("updateTeacherOwnInfo", teacher);
	}

	public void updateTeacherOwnPassword(Teacher teacher) {
		getSqlMapClientTemplate().update("updateTeacherPassword", teacher);
	}

}
